 /******************************************************************************
  * @file    PT32X005_pwr.h
  * @author  应用开发团队
  * @version V1.1.0
  * @date    2020/1/27
  * @brief    This file contains all the functions prototypes for the PWR firmware library.
  *
  ******************************************************************************
  * @attention
  *
  *
  *****************************************************************************/


/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef PT32X005_PWR_H
#define PT32X005_PWR_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "PT32X005.h"


/** @addtogroup PWR
  * @{
  */


/** @defgroup IS_PVD_LEVEL_SEL  **/
#define IS_PVD_LEVEL_SEL(SEL)	(((SEL) == PWR_PLS_Level0) || \
								((SEL) == PWR_PLS_Level1)|| \
								((SEL) == PWR_PLS_Level2) || \
								((SEL) == PWR_PLS_Level3)|| \
								((SEL) == PWR_PLS_Level4))

/** @defgroup IS_PWR_SLEEP_ENTRY  **/
#define PWR_SLEEPEntry_WFI              ((u8)0x01)
#define PWR_SLEEPEntry_WFE              ((u8)0x02)
#define IS_PWR_SLEEP_ENTRY(ENTRY)	(((ENTRY) == PWR_SLEEPEntry_WFI) ||\
									((ENTRY) == PWR_SLEEPEntry_WFE))


/** @defgroup PWR_STOP_mode_entry
  * @{
  */

#define PWR_STANDBYEntry_WFI               ((u8)0x01)
#define PWR_STANDBYEntry_WFE               ((u8)0x02)
#define IS_PWR_STANDBY_ENTRY(ENTRY)	(((ENTRY) == PWR_STANDBYEntry_WFI) || \
										((ENTRY) == PWR_STANDBYEntry_WFE))


/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void PWR_PVDLevelConfig(u32 PWR_PVDLevel);
void PWR_LVDLevelConfig(u32 PWR_LVDLevel);
void PWR_PVDCmd(FunctionalState NewState);
void PWR_EnterSleepMode(u8 PWR_SLEEPEntry);
void PWR_EnterSTANDBYMode(u8 PWR_DeepStandbyEntry);

#ifdef __cplusplus
}
#endif

#endif

